package com.pkx.guide.info.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pkx.guide.common.annotation.ORpose;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pkx.guide.info.entity.TInfoGuidePlayListDevice;
import com.pkx.guide.info.service.TInfoGuidePlayListDeviceService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import com.pkx.guide.common.annotation.Log;
import com.pkx.guide.common.enums.BusinessType;
import lombok.extern.slf4j.Slf4j;

/**
 * 诱导屏播放表设备关联表 控制器
 *
 * @author sunsy
 * @since 2023-12-20
 */
@RestController
@RequestMapping("/info/playListDevice")
@Tag(name = "诱导屏播放表设备关联表")
@Slf4j
@ORpose
public class TInfoGuidePlayListDeviceController {

    @Autowired
    private TInfoGuidePlayListDeviceService tInfoGuidePlayListDeviceService;

    @Operation(summary = "诱导屏播放表设备关联表分页列表")
    @GetMapping("/page")
    public IPage<TInfoGuidePlayListDevice> page(Page page, TInfoGuidePlayListDevice tInfoGuidePlayListDevice) {
        return tInfoGuidePlayListDeviceService.pageList(page,tInfoGuidePlayListDevice);
    }

    @Operation(summary = "诱导屏播放表设备关联表列表")
    @GetMapping("/list")
    public List<TInfoGuidePlayListDevice> list(TInfoGuidePlayListDevice tInfoGuidePlayListDevice) {
        return tInfoGuidePlayListDeviceService.listByEntity(tInfoGuidePlayListDevice);
    }

    @Operation(summary = "诱导屏播放表设备关联表详情")
    @GetMapping(value = "/{id}")
    public TInfoGuidePlayListDevice selectById(@PathVariable("id") Integer id) {
        return tInfoGuidePlayListDeviceService.selectById(id);
    }

    @Operation(summary = "诱导屏播放表设备关联表新增")
    @PostMapping("/")
    @Log(title = "诱导屏播放表设备关联表", businessType = BusinessType.INSERT)
    public Boolean add(@RequestBody TInfoGuidePlayListDevice tInfoGuidePlayListDevice) {
        return tInfoGuidePlayListDeviceService.saveTInfoGuidePlayListDevice(tInfoGuidePlayListDevice);
    }

    @Operation(summary = "诱导屏播放表设备关联表修改")
    @PutMapping("/")
    @Log(title = "诱导屏播放表设备关联表", businessType = BusinessType.UPDATE)
    public Boolean modify(@RequestBody TInfoGuidePlayListDevice tInfoGuidePlayListDevice) {
        return tInfoGuidePlayListDeviceService.modify(tInfoGuidePlayListDevice);
    }

    @Operation(summary = "诱导屏播放表设备关联表删除(单个条目)")
    @DeleteMapping(value = "/{id}")
    @Log(title = "诱导屏播放表设备关联表", businessType = BusinessType.DELETE)
    public Boolean deleteById(@PathVariable("id") Integer id) {
        return tInfoGuidePlayListDeviceService.deleteById(id);
    }
}
